<template>
  <div id="shop-product-purchase-list-page">
    <div class="page-title" :style="{
      top:(this.getSafeArea().top)+'px'
    }">
      <div id="back-button" @click="$router.push('/MemberHome')">
        <i href="javascript:void(0)" class="el-icon-arrow-left"></i>
      </div>
      <span>采购订单列表</span>
    </div>
    <i-scroller-box
      id="shop-product-purchase-list" ref="i-scroller-box"
                    url="Order/getProductPurchaseList"
      style="position: relative"
                    :height="getWinSize().height-this.getSafeArea().top0"
                    :style="{
                      top:(this.getSafeArea().top)+'px',
                      width:'100%'
                    }">
      <template v-slot:list-item="{index,data}">
        <div class="row-item" :key="index" @click="detail(data)">
          <div class="content-box">
            <div class="line1">
              <div class="number">
                NO: <span v-text="data.orderNo"></span>
              </div>
              <div class="price">
                总金额: <span v-text="'￥'+ToMoney(data.money)"></span>
              </div>
            </div>
            <div class="line2">
              <div class="left">
                <div class="item">
                  商品: {{ data.nums }}
                </div>
                <div class="item">
                  已采购: {{ data.buyNums }}
                </div>
                <div class="c"></div>
              </div>
              <div class="right">
                {{ data.createdTime }}
              </div>
            </div>
          </div>
          <div class="icon-box">
            <i class="el-icon-arrow-right"></i>
          </div>
        </div>
      </template>
    </i-scroller-box>


  </div>
</template>

<script>
import IScrollerBox from '../common/IScrollerBox'

export default {
  name: 'ShopProductPurchaseList',
  components: {IScrollerBox},
  data: function () {
    return {}
  },
  mounted () {
    this.getList()
  },
  methods: {
    detail: function (shopProductPurchase) {
      // localStorage.setItem("ShopProductPurchaseDetailData",JSON.stringify(shopProductPurchase))
      this.$router.push('/ShopProductPurchaseDetail?orderNo=' + shopProductPurchase.orderNo)
    },
    getList: function () {
      this.$refs['i-scroller-box'].getList()
    }
  }
}
</script>

<style scoped>

</style>
